$.extend({
    request: {
        post(url, data, callback, options) {
            const dataType = options && options.dataType
            this.submit(url, 'post', dataType, data, callback)
        }, get(url, params, callback, options) {
            const dataType = options && options.dataType
            this.submit(url, 'get', dataType, params, callback)
        }, remove(url, data, callback, options) {
            const dataType = options && options.dataType
            this.submit(url, 'put', dataType, data, callback)
        }, put(url, data, callback, options) {
            const dataType = options && options.dataType
            this.submit(url, 'put', dataType, data, callback)
        }, submit(url, type, dataType = 'json', data, callback) {
            var config = {
                url: url,
                type: type,
                dataType: dataType,
                data: data,
                beforeSend: function () {
                },
                success: function (result) {
                    if (typeof callback == "function") {
                        callback(result);
                    }
                }
            };
            $.ajax(config)
        }
    },
    commonBusiness: {
        getIncrementWeight(url, params , name='weight') {
            $.request.get(url+"/getIncrementWeight",params,(result)=>{
                const weight = result.data
                $("[name="+name+"]").val(weight)
            })
        }
    }
})